﻿using Microsoft.AspNetCore.Authorization;

namespace FileService.WebAPI.Uploader;

[ApiController]
[Route("[Action]")]
[Authorize(Roles = "Admin")]
public class UploaderController : ControllerBase
{
    private readonly FileDbContext _dbContext;
    private readonly IStorageClient _repository;

    public UploaderController(FileDbContext dbContext, IStorageClient repository)
    {
        this._dbContext = dbContext;
        this._repository = repository;
    }
    
    [HttpGet]
    public IActionResult GetPolicy(CancellationToken cancellationToken = default)
    {
        return Ok(new {Code = 200, Data = _repository.GetPolicyAsync(cancellationToken), Msg="获取成功"});
    }
}
